﻿using System;
using System.Data;
using System.Collections.Generic;
using eTMS.Controllers.ThoiGianGiangDayService;
namespace eTMS.Controllers{
public class ThoiGianGiangDayControllerBase : CommonController{
	public ThoiGianGiangDayControllerBase()
		: base()
	{	
		this.dao = new ThoiGianGiangDayServiceClient();
	}
	protected ThoiGianGiangDayServiceClient dao;
	~ThoiGianGiangDayControllerBase(){
		try{dao.Close();}catch{}
	}
    //Copy data from data row in grid to object
    public ThoiGianGiangDayEntity MapDataRowToObject(DataRow row){
		ThoiGianGiangDayEntity o = new ThoiGianGiangDayEntity();
		 if(!row.IsNull("ThoiGianGiang_ID"))
			o.ThoiGianGiang_ID=ConvertInt(row["ThoiGianGiang_ID"]);
		 if(!row.IsNull("Thu_ID"))
			o.Thu_ID=(Int32)(row["Thu_ID"]);
		 if(!row.IsNull("TietHoc_ID"))
			o.TietHoc_ID=(Int32)(row["TietHoc_ID"]);
		 if(!row.IsNull("ThoiGianGiang_ID"))
		    o.ThoiGianGiang_ID=(Int32)(row["ThoiGianGiang_ID"]);
		 return o;
    }
	//Copy data from object to data row in grid    
    public void MapObjectToDataRow(ThoiGianGiangDayEntity o,DataRow row){
		row["ThoiGianGiang_ID"]=o.ThoiGianGiang_ID;
		row["Thu_ID"]=o.Thu_ID;
		row["TietHoc_ID"]=o.TietHoc_ID;
		row["ThoiGianGiang_ID"]=o.ThoiGianGiang_ID;
    }
}
}
